﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace CNKI.TPI.Web.Admin.IDAO
{
    public interface IUserCenterDAO
    {
        DataTable GetSearchPage(IList<int> dbid, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);
        DataTable GetSearchPage(IList<int> dbid, DateTime? startDate, DateTime? endDate, string userid, string startIP, string endIP);
        DataTable GetViewPage(IList<int> dbid, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);
        DataTable GetViewPage(IList<int> dbid, string title, DateTime? startDate, DateTime? endDate, string userid, string startIP, string endIP);
        DataTable GetDownPage(IList<int> dbid, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);
        DataTable GetDownPage(IList<int> dbid, string title, DateTime? startDate, DateTime? endDate, string userid, string startIP, string endIP);
        /// <summary>
        /// 获取收藏分类类别
        /// </summary>
        /// <returns></returns>
        DataTable GetFavoriteCategory(string userCode, int startIndex, int pagecount, out int count);
        DataTable GetFavoriteCategory(string userCode);


        /// <summary>
        /// 新增分类数据
        /// </summary>
        /// <param name="catename"></param>
        /// <param name="catestatus"></param>
        /// <param name="sortno"></param>
        /// <param name="usercode"></param>
        /// <returns></returns>
        bool InsertFavoriteCategory(string catename, int catestatus, int sortno, string usercode);

        /// <summary>
        /// 更新分类名称
        /// </summary>
        /// <param name="catename"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool UpdateFavoriteCategoryName(string catename, int id);

        /// <summary>
        /// 更新分类顺序
        /// </summary>
        /// <param name="sortno"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool UpdateFavoriteCategorySort(int sortno, int id);

        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelFavoriteCategory(int id); 
        /// 获取最大的序号
        /// </summary>
        /// <returns></returns>
        int GetMaxSort();

        /// <summary>
        /// 判断是否存在分类名称 ，如果已经存在返回该记录ID，不存在返回0
        /// </summary>
        /// <returns></returns>
        int IsExistFavName(string userCode, string name);
           /// <summary>
        /// 新增收藏记录
        /// </summary>
        /// <param name="catename"></param>
        /// <param name="catestatus"></param>
        /// <param name="sortno"></param>
        /// <param name="usercode"></param>
        /// <returns></returns>
        bool InsertFavoriteFolder(int favCateID, string dbCode, string dbName, string recid, string recTitle);
        /// <summary>
        /// 获取收藏列表
        /// </summary>
        /// <returns></returns>
        DataTable GetFavoriteFolder(int catid, string dbname, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);
 

        /// <summary>
        /// 更新收藏记录
        /// </summary>
        bool UpdateFavoriteFolder(int favCateID, int floderid);
   
        /// <summary>
        /// 删除收藏记录
        /// </summary>
        bool DelFavoriteFolder(int floderid);
        bool DelFavoriteFolderBath(string floderid);
        /// <summary>
        /// 取消收藏
        /// </summary>
        /// <param name="recid"></param>
        /// <returns></returns>
        bool UpdateFavStatusByRecID(int recid);
   
       /// <summary>
        /// 根据数据库code获取该数据库的收藏记录
        /// </summary>
        /// <param name="dbcode"></param>
        /// <returns></returns>
        DataTable GetFavFolderList(string dbcode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="searchLogID"></param>
        /// <returns></returns>
        DataTable GetSearchLogInfo(int searchLogID);

    }
}
